package com.heima.crm.pojos.user;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
public class UserPageDto {

    private String nickName;

    private String phonenumber;

    private String status;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate startTime;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate endTime;

    private Integer pageSize;

    private Integer pageNum;

    public void checkParam() {
        if (this.pageNum == null || this.pageNum < 0) {
            setPageNum(1);
        }
        if (this.pageSize == null || this.pageSize < 0 || this.pageSize > 100) {
            setPageSize(10);
        }
    }

}
